<template>
  <div class="header">
    <div class="header-left">
      <span class="icon iconfont">&#xe685;</span>
    </div>
    <div class="header-input">
      <span class="iconfont">&#xe684;</span>
      请输入要查找的地址
    </div>
    <router-link to="/city">
      <div class="header-rigth">
        {{ this.city }}
        <span class="iconfont">&#xe688;</span>
      </div>
    </router-link>
  </div>
  <!-- <div>ssss</div> -->
</template>

<script>
import { mapState } from "vuex";
export default {
  name: "HomeHeader",
  // 计算属性
  computed: {
    ...mapState(["city"]),
  },
};
</script>

<style lang="stylus" scoped>
@import '~styles/varibles.styl';

.header {
  display: flex;
  height: $headerHeight;
  line-height: $headerHeight;
  background-color: $bgColor;
}

.header-left {
  width: 0.64rem;
  color: #fff;
  // background-color: green;
}

.icon {
  text-align: center;
  font-size: 0.4rem;
  margin-left: 0.12rem;
}

.header-input {
  flex: 1;
  margin-top: 0.12rem;
  height: 0.64rem;
  line-height: 0.64rem;
  background: #fff;
  border-radius: 0.1rem;
  margin-left: 0.12rem;
  padding-left: 0.2rem;
}

.header-rigth {
  min-width: 1.04rem;
  // width: 1.04rem;
  padding: 0 0.1rem;
  text-align: center;
  color: #fff;
  // background-color: green;
}
</style>

